<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/23
 * Time: 11:10
 */

namespace app\api\controller\v2;


use app\api\lib\exception\SuccessMessage;
use app\api\model\FacePay;
use app\api\model\Order;
use app\api\model\OrderDetail;
use app\api\model\PointsBill;
use app\api\service\TokenService;
use think\Db;

class PointsBillController extends BaseController
{
    public function _initialize()
    {
        $this->uid = TokenService::getCurrentUid();
    }

    public function getMyPointsBill()
    {
        $result['data'] = Db::table('points_bill')->where('user_id',$this->uid)->field(['points','status','create_time'],false)->select();
        $result['total'] = Db::table('user')->where('id',$this->uid)->field('points')->find()['points'];
        throw new SuccessMessage([
            'data' => $result
        ]);
    }
}